const express = require('express');
const router = express.Router();
const { check } = require('express-validator');
const commentController = require('../controllers/commentController');
const authMiddleware = require('../middleware/auth');

router.post(
    '/:post_id',
    authMiddleware,
    [check('content').notEmpty().withMessage('Content is required')],
    commentController.create
);

router.get('/:post_id', commentController.getByPostId);

module.exports = router;